package com.xinqi.modules.course.chapter.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xinqi.common.green.annotation.Text;
import com.xinqi.common.mybatis.data.entity.BaseEntity;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 课程章节表(CourseChapter)表实体类
 *
 * @author liuxingxing
 * @since 2023-03-08 10:10:39
 */
@SuppressWarnings("serial")
@TableName("co_course_chapter")
@Data
public class CourseChapterEntity extends BaseEntity {

    /** 班级id */
    @NotNull(message = "班级id")
    @TableField(value = "class_id")
    private Long classId;

    /** 课程id */
    @TableField(value = "course_id")
    private Long courseId;

    /** 父章id*/
    @Min(value = 0, message = "父id最小值为0")
    @NotNull(message = "父id非空")
    @TableField(value = "pid")
    private Long pid;

    /** 节名称 */
    @Text
    @NotEmpty(message = "章节名称不能为空")
    @TableField(value = "name")
    private String name;

    /** 排序*/
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 是否有内容：1-有，0-无，标记云课本
     */
    @TableField(value = "is_has_content")
    private Integer isHasContent;

    /**
     * 是否云课本目录，0-否,1-是
     */
    @TableField(value = "is_cloud_textbook_catalog")
    private Integer isCloudTextbookCatalog;
}
